<template>
  <div>
    <el-tabs v-model="activeName" type="border-card" @tab-click="tabClick">
      <el-tab-pane label="待办项目" name="finish">
        <keep-alive>
          <finish @toIt="toIt" :switch="true" :status="status" ref="finish"></finish>
        </keep-alive>
      </el-tab-pane>
      <el-tab-pane label="资产信息" name="it" :disabled="itType">
        <it @toIndex="toIndex" ref="it" :switch="itSwitch"></it>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
import Finish from './finish.vue';
import it from '../components/it.vue';
export default {
  name: 'Inside',
  components: {
    Finish, it

  },
  props: {

  },
  data () {
    return {
      activeName: 'finish',
      true: true,
      false: false,
      status: '3',
      itSwitch: false,
      itType: true
    }
  },
  created () {

  },
  mounted () {
    this.$refs.finish.init()
  },
  methods: {
    tabClick (tab) {
      if (tab.name === 'finish') {
        this.$refs.finish.init()
      } else if (tab.name === 'it') {
        this.$refs.it.init()
      }
    },
    toIt (val) {
      this.itType = false
      this.itSwitch = val
      this.$refs.it.init()
      this.activeName = 'it'
    },
    toIndex (val) {
      this.activeName = 'finish'
    },
  },
  computed: {

  }
}
</script>
<style lang="scss" scoped>
</style>
